#include<iostream>
#include<vector>
#include<list>
#include<algorithm>
#include<set>
#include<deque>
using namespace std;

int main()
{
	list<int> coll1;
	
	//insert elements from 1 to 9 into the first collection
	for(int i=0;i<=9;i++){
		coll1.push_back(i);
	}
	
	//copy the elements of coll1 into coll2 by appending them
	vector<int> coll2;
	copy(coll1.begin(),coll1.end(),back_inserter(coll2));
	
	//copy elements of coll1 into coll3 by insert them at the front
	//- reverses the order of the elements
	deque<int> coll3;
	copy(coll1.begin(),coll1.end(),front_inserter(coll3));
	
	//copy elements of coll1 into coll4 
	//- only inserter that works for associative collections
	set<int> coll4;
	copy(coll1.begin(),coll1.end(),inserter(coll4,coll4.begin()));
	
	cout<<"coll2:";
	for(vector<int>::iterator it=coll2.begin();it!=coll2.end();it++){
		cout<<*it<<" ";
	}
	cout<<endl;

	cout<<"coll3:";
	for(deque<int>::iterator it=coll3.begin();it!=coll3.end();it++){
		cout<<*it<<" ";
	}
	cout<<endl;

	cout<<"coll4:";
	for(set<int>::iterator it=coll4.begin();it!=coll4.end();it++){
		cout<<*it<<" ";
	}
	cout<<endl;
	
	return 0;
}